/*
 * ModuleFactory.java
 * 
 * last update: 16.01.2010 by Stefan Saru
 * 
 * author:	Alec(panovici@elcom.pub.ro)
 * 
 * Obs:
 */

package engine;

import java.util.*;
import middle.*;
import java.io.Serializable;

/**
 * Used by ModuleInstnceDescription to create a
 * new module instance by calling createNewModule on the
 * descriptor. Its use is that provides a means of hiding the
 * specific module interfacing mechanism (for an example UDPs
 * have internal wires for ports while standard primitives 
 * are 'void', etc.) from the ModuleInstanceDescription, which
 * is a common class to all module instances.
 */

public interface ModuleFactory extends Serializable{
	/*
	 * The exception should not normally be caught,
	 * since it is thrown from an instantiateAll
	 * (it has a well formed error message)
	 */
	Object createNewModule(NameSpace parent,
			ModuleInstanceDescription miDesc,
			byte strength,
			ScopeNode scope) throws ParseException;

	Object createNewModuleArray(NameSpace parent,
			ModuleInstanceDescription miDesc,
			byte strength,
			ScopeNode scope, int ars, int are,
			int n, int increment)
	throws ParseException;

	/**
	 * Sets the parameters for the
	 * following instantiations.
	 */
	 void setParams(Vector results, Delay3 delays) throws ParseException;

	 /**
	  * Reverses the parameters to their default values.
	  */
	 void unsetParams();

	 boolean isTop();

	 String name();
}




